<?php $this->load->view('templates/header');?>

<body style="padding-top: 0px;">
<nav class="navbar navbar-default" style="background-color: #f9f9f9; border-bottom:1px solid #d5d5d5">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

      <ul class="nav navbar-nav navbar-right">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><?php echo anchor('auth/manage_photos','參賽作品')?></li>
            <li><?php echo anchor('auth/voter_info','投票者資料')?></li>
            <li><?php echo anchor('auth/logout','登出')?></li>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>


<h1 style="text-align:center">參賽作品</h1>


<div id="infoMessage"></div>

<?php echo form_open("auth/approve_photos"); ?>
<table class="sortable table table-striped photo-table">
	<tr>
		<th>選擇</th>
        <th>相片編號</th>
        <th>相片</th>
        <th>喜愛的功能及原因</th>
		<th>英文姓名</th>
		<th>電郵地址</th>
		<th>手機號碼</th>
		<th>Facebook ID</th>
		<th>Facebook name</th>
        <th>Facebook email</th>
        <th>收取推廣電郵及短訊意願</th>
        <th>Status</th>
        <th>票數</th>
	</tr>
	<?php foreach ($photo_lists as $photo_list):?>
		<tr>
            <td><input type="checkbox" name="photoList[]" value="<?php echo $photo_list['id']?>" id="<?php echo $photo_list['id']?>" style="margin:10px; transform:scale(1.6)" /></td>
            <td><?php echo $photo_list['id'];?></td>
            <td><a href="<?php echo $photo_list['photo'];?>" data-toggle="lightbox" ><img src='<?php echo $photo_list['photo'];?>' width="100" height="100" id="<?php echo $photo_list['id']?>"></a></td>
            <td><?php echo $photo_list['photo_title'];?></td>
            <td><?php echo $photo_list['english_name'];?></td>
            <td><?php echo $photo_list['email'];?></td>
			<td><?php echo $photo_list['phone'];?></td>
			<td><?php echo $photo_list['fb_id'];?></td>
			<td><?php echo $photo_list['fb_name'];?></td>
            <td><?php echo $photo_list['fb_email'];?></td>
            <td><?php if($photo_list['marketing'] == '1'){?>
            <span class="label label-success">同意</span>
            <?php }else{?>
            <span class="label label-danger">不同意</span>
            <?php }?>
            </td>
            <td><?php if($photo_list['status'] == '1'){?>
            <span class="label label-success">Approved</span>
            <?php }else{?>
            <span class="label label-danger">Disapproved</span>
            <?php }?>
            </td>
            <td><?php echo $photo_list['results'];?></td>
		</tr>
	<?php endforeach;?>
</table>
<?php echo anchor('auth/export_csv_contestants','Export to CSV', 'class="btn btn-default btn-export-contestants"')?>
<?php echo form_submit('approve', 'Disapprove', 'class="btn btn-default btn-disapprove"'); ?>
<?php echo form_submit('approve', 'Approve', 'class="btn btn-default btn-approve"'); ?>
<?php echo form_close(); ?>

<?php $this->load->view('templates/footer');?>

<script>
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
    event.preventDefault();
    $(this).ekkoLightbox();
}); 
</script>

</body>